# Contributor: Nathan Caldwell <saintdev@gmail.com>
# Maintainer: Nathan Caldwell <saintdev@gmail.com>
pkgname=snapraid
pkgver=12.2
pkgrel=0
pkgdesc="A backup program for disk arrays"
url="https://www.snapraid.it"
arch="all !s390x" # tests fails on s390x
license="GPL-3.0-only"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/amadvance/snapraid/releases/download/v$pkgver/snapraid-$pkgver.tar.gz"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="2c19c0e336e6e42c8b44bd3f3ccfdc4dfae901f166b0825deb471919dc22f98e92a6d64557b6fed3648b332d4432735db7998656d60bf173925a91c90b099bad  snapraid-12.2.tar.gz"
